package comtgl.demo.utils;

import comtgl.demo.dto.ResponseBean;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestTemplate;

import java.util.HashMap;
import java.util.Map;

public class RestTemplateUtils {

    @Autowired
    private static RestTemplate restTemplate;
    public static void main(String[] args) {
        String  url = "http://www.xxxx.com?userId={userId}&begin={begin}&end={end}";
        Map<String,String> map = new HashMap<>();
        map.put("userId", "1");
        map.put("begin", "1");
        map.put("end", "10");
        ResponseEntity<ResponseBean> forEntity = restTemplate.getForEntity(url, ResponseBean.class, map);

    }
}
